/*
 * IHomeModel.java
 * business
 *
 * Created by ChenTao on 2016/9/9.
 *
 * Copyright (c) 2016年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.bean.Goods;
import com.yidiandao.business.data.recyclertype.DoubleGoods;
import com.yidiandao.business.data.response.QueryFrameResponse;
import com.yidiandao.business.data.response.QueryHomeHeaderResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/** 首页 - Model */
public interface IHomeModel {

    /** 加载首页顶部数据 */
    void loadHomeData(String tag, OnLoadHomeHeaderListener listener);

    /** 加载首页-最新 商品列表 */
    void loadNewGoodsList(boolean isRefreshing, String tag, OnLoadGoodsListener listener);

    /** 获取活动对话框展示的图片 */
    void getFrame(String tag, OnFrameListener listener);

    /** 单独获取秒杀的数据 */
    void getSecondKillData(String tag, OnLoadSecondKillListener listener);

    interface OnLoadListener {

        void onSuccess(List<DisplayListItem> displayListItems);

        void onFailed();
    }

    interface OnLoadHomeHeaderListener extends OnLoadListener {

        /** Banner数据和公告 */
        void onBanner(List<QueryHomeHeaderResponse.Banner> banners, List<String> bannerUrls);
    }

    interface OnLoadGoodsListener {

        void onSuccess(
                List<Goods> goodsList,
                List<DoubleGoods> goodsGridList,
                boolean emptyResult,
                boolean hasMoreData);

        void onFailed();
    }

    interface OnLoadSecondKillListener {

        void onSuccess();

        void onFinal();
    }

    interface OnFrameListener {

        void onSuccess(QueryFrameResponse.Frame frame);

        void onFinal();
    }
}
